package com.supply.controller;

import com.supply.utils.OssUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/upload")
public class uploadController {

    //上传头像
    @PostMapping("/uploadAvatar")
    public String upload(MultipartFile file) throws IOException {
        return OssUtils.upload(file.getOriginalFilename(),file.getInputStream());
    }
}
